<%@ include file="IsStudent.jsp"%>
        <%@ page import="java.util.*,java.sql.*" %>
        
        <%
        String un= (String) session.getAttribute("un");
        int id=(Integer) session.getAttribute("id");
        String check [] = new String[3];
        int projId [] = new int[3];
        String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
        
        check = request.getParameterValues("pro");
        for(int i=0; i<check.length; i++)
        {
        if (check[i] == null)
        projId [i] = 0;
        else 
        projId[i] = Integer.parseInt(check[i]);
        
        out.println("Check  "+i+" | "+projId[i]);
        }
        
        
        try {
        Class.forName(driver);
        
        Connection connection = DriverManager.getConnection("jdbc:odbc:SPMS","","");
        
        Statement statement = connection.createStatement();
        for(int j=0; j< projId.length; j++)
        {
            if (projId[j] != 0)
            {
                String query = "DELETE * FROM StudentProject WHERE StudentId="+ id + "AND ProjectId ="+projId[j]; 
                statement.executeUpdate(query);
            }
        }
        response.reset();
        response.sendRedirect("../Student/myChoice.jsp");
        } catch(ClassNotFoundException cnfe) {
        out.println("No such class: " + driver);
        } catch(SQLException se) {
        out.println("SQLException: " + se);
        }
        %>
